# coding:utf-8
# @Time : 2021/5/10 15:16 
# @Author : minuy
# @File : file_tool.py
from flask import url_for
from app.config import HOST_NAME


def get_file_url(file_name):
    """
    获取文件完整URL
    :param file_name: 文件名
    :return: 文件url
    """
    host_name = HOST_NAME
    if host_name:
        url = host_name + url_for('web.get_file', filename=file_name)
        return url
    else:
        return 'http://localhost:5000' + url_for('web.get_file', filename=file_name)
